package extensionfilter;

import java.io.File;
import java.util.List;

public class Demo {
    public static void main(String[] args) {
        ExtensionFilter extensionFilter = new ExtensionFilter();
        File file = new File("day21-file/def");
        String extension = "jpg";

        extensionFilter.filterFilesByExtension(file,extension);

        List<String> results = extensionFilter.getFilteredFiles(); //获取过滤的文件

        if (results.isEmpty()) {
            System.out.println("没有找到任何扩展名为 ." + extension + " 的文件。");
        }
    }
}
